package cn.base.day09;

import java.util.Scanner;

public class Test01 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个字符串(必须包含数字和字母)：");
        String next = sc.next();
        char[] c = next.toCharArray();
        StringBuilder num = new StringBuilder();//存数字
        StringBuilder s1 = new StringBuilder();//存字母
        for (int i = 0; i < c.length; i++) {
            if (c[i] >= '0' && c[i] <= '9') {
                num.append(c[i]);
            }
            if (c[i] >= 'a' && c[i] <= 'z' || c[i] >= 'A' && c[i] <= 'Z') {
                s1.append(c[i]);
            }
        }
        System.out.println(num);
        System.out.println(s1);
        System.out.println(num.append(s1));

    }
}
